#!/usr/bin/env node

const cheerio = require('cheerio'),
      log = console.log,
      http = require('http'),
      https = require('https'),
      addUrl = 'http://www.meiju8.cc/movie/94657.html';
let movieURL = '',
    movieHref = '';
https.get(addUrl,(res) => {
      let result = '';
      res.on('data',(data)=>{
        result += data.toString('utf8');
      })
      res.on('end',()=>{ 
          let $ = cheerio.load(result);
          movieHref = $('body').find('.mn_list_li_movie>a').attr('href');
          movieURL = addUrl + movieHref;
      })
})
http.createServer((req,res) => {
    res.write(`
      <html>
        <head></head>
        <body>
          <button>播放</button>
        </body>
      </html>`);
    
}).listen(3000);

